import { defineStore } from 'pinia';
import { useRouterMenu } from '@/hooks/router/useRouterMenu';
import { type LabelKeyMap } from '@/utils/router/menu';
// import { Badge } from 'ant-design-vue';

export const useCompanyMenuStore = defineStore('companyMenu', () => {
  // 通过key映射自定义菜单项的label
  const labelKeyMap = reactive<LabelKeyMap>({
    // FIXME: 当前菜单组件存在问题，该功能不可用 ant-design-vue@4.0.7
    // CompanyHrOrg: route => h(Badge, { count: 8, offset: [12, 0] }, () => route.meta?.title),
  });

  const { menuItems, selectedKeys, openKeys } = useRouterMenu('Company', labelKeyMap);

  return {
    menuItems,
    selectedKeys,
    openKeys,
  };
});
